package cn.com.Controller;

import java.util.UUID;

import com.jfinal.core.Controller;

import cn.com.bean.User;

/**
 * <p>Title: UserController</p>  
 * <p>Description: </p>  
 * @author WangJun
 * @date 2018年9月15日 下午2:33:41
 */
public class UserController extends Controller{
	public void add() {
//		User user = getModel(User.class);
//		System.out.println("名称"+ user.get("name")+"年龄"+user.getInt("age"));
		String name = getPara("name");
		Integer age = getParaToInt("age");
		System.out.println(name+age);
		
		boolean save = new User().set("id", 5).set("user_name", name).set("password", age).save();
		if(save) {
			setAttr("msg", "success 添加成功");
		} else {
			setAttr("msg", "error 添加失败");
		}
		render("/index.html");
	}
}
